#pragma once
#include <QAxObject>
#define qExcel (ExcelManager::Instance())

class ExcelManager
{
public:
    QStringList sheetsNames;
    QAxObject * Application;

    static ExcelManager *Instance();
    ~ExcelManager();    // 构造函数

    void setVisible(bool visible);   // 设置Excel程序是否可见
    void quit();                     // Excel 退出

    void addWorkBook();                // 增加工作簿
    void openWorkBook(QString &fileName);                // 打开工作簿
    void getWorkSheetsName();     // 获取工作表的名称
    void getActiveSheet();

    void appendToActSheet(QVariantList list );

    QAxObject *Rows(int row);
private:
    explicit ExcelManager(QObject *parent = 0);    // 构造函数
    static ExcelManager *self;

    QAxObject * WorkBooks;
    QAxObject * ActiveWorkbook = 0;
    QAxObject * WorkSheets;
    QAxObject * activeSheet=0;
};

